package net.hn.hnms.biz.activiti.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Author: PanSX
 * Date: 2023/8/25 16:13
 */
@Entity
@Table(name = "cssit_process")
@Data
public class MyProcess {
    @Id
    private String id;
    @ApiModelProperty("流程分类")
    private String proType;
    @ApiModelProperty("流程名称")
    private String proName;
    @ApiModelProperty("发起人")
    private String startUser;
    @ApiModelProperty("工号")
    private String userNo;
    @ApiModelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date startTime;

    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date endTime;

    @ApiModelProperty("当前任务节点")
    private String currentTask;

    @ApiModelProperty("当前任务节点id")
    private String currentTaskId;

    @ApiModelProperty("流程状态")
    private String processStatus;

    @ApiModelProperty("如果是已作废，请前端同事显示作废原因")
    private String deleteReason;

    @OneToMany(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
    @ApiModelProperty(value = "节点信息")
    @JoinColumn(name = "process_id", referencedColumnName = "id")
    private List<MyTask> tasks=new ArrayList<>();
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date updateTime=new Date();
    private String mineCode;

}
